package com.qfedu.dao.impl;

import com.qfedu.dao.HistoryDao;
import com.qfedu.pojo.History;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;

public class HistoryDaoImpl extends BaseDao implements HistoryDao {
    @Override
    public int addHistory(String idcode, String transferee, String outtransferee, BigDecimal money, String time, int status) {
        String sql="insert into bank_history values(?,?,?,?,cast(? as datetime),?)";
        return update(sql,idcode,transferee,outtransferee,money,time,status);
    }

    @Override
    public List<History> findHistory(String idcode, int status,String time) {
        String sql="select * from bank_history where idcode=? and status=? and time like ?";
        return queryForList(History.class,sql,idcode,status,time+"%");
    }
}
